<?php
require 'Home/View/index/head.php';

$row=$data['cartoon_s'];

?>

<link href="./assets/css/bootstrap.min.css" rel="stylesheet">
  <script src="./assets/js/jQuery.min.js"></script>
  <script src="./assets/js/bootstrap.min.js"></script>

<div style="color:white;"class="row">
  <div class="col-md-10 col-md-offset-1 mlist">
    <div class="col-md-4">
      <img src="./posters/<?php echo $row["pic"];?>" width="200" height="250">
          <ul class="list-inline row text-center">
           <li>
           <h3><!-- <a href="index.php?c=index&m=show&cid=<?php echo $row["cid"];?>"> --><?php echo $row["cartoonname"];?></a></h3></li>  
          </ul>
          <ul class="list-inline row text-center">
          <li><h4><font color=yellow>影片评分：</font></h4></li>10 </ul>
    </div>
    <div class="col-md-6">
       <table class="table">
          <tr>
          <td style="color: blue" >专栏</td>
          <td style="color: red" >
          <?php 
          switch ($row['tid']) {
            case 1:
              echo "日本专栏";
              break;
            case 2:
              echo "大陆专栏";
              break;
            case 3:
                echo "欧美专栏";
              break;
            case 4:
              echo "其它";
              break;
          }
          ?>
          </td>
          </tr>
          <tr>
          <td style="color: blue" >上传时间</td>
          <td style="color: blue" ><?php echo $row["uploaddate"];?></td>
          </tr>
          <tr>
          <td style="color: blue" >点击次数</td>
          <td style="color: blue" ><?php echo $row["hittimes"];?></td>
          </tr>
          <tr>
          <td style="color: blue" >下载次数</td>
          <td style="color: blue" ><?php echo $row["downtimes"];?></td>
          </tr>
          <tr>
          </tr>
          <tr>
          <td style="color: blue" >下载地址</td>
          <td style="color: blue" >
            <p><a href="down.php?cid=<?php echo $row['cid']; ?>"><?php echo $row["address"];?></a></p>        
          </td>
          </tr>
          <tr>
          <td style="color: blue" >联系方式</td>
          <td style="color: blue" >
            <p><a href="#">意见箱</a></p>
          </td>
          </tr>
           <tr>
        <td style="color: blue" >评分</td>
        <td>
     <?php  
        //登陆后才能评分
        if(isset($_SESSION['user']))
        {
     ?>


    <form action="index.php?c=index&m=levelresult"  method="get" onsubmit="check()" class="form-horizontal">
    <input type="hidden" name="cid" value= <?php echo $row['cid']; ?>>
    <select style="color:red;" name="level" required>
        <option value="">评价影片</option>
        <option value="5">力推★★★★★</option>
        <option value="4">推荐★★★★</option>
        <option value="3">一般★★★</option>
        <option value="2">较差★★</option>
        <option value="1">很差★</option>
    </select>
    <input type="submit" value="评价">
    </form>


    <?php  
        
        }else{
    ?>
    <h3><a href="index.php?c=index&m=login" onclick="func( <?php echo $row['cid']; ?>)">登陆</a>后可以评分</h3>
    <?php  
        }
    ?>
        </td>
    </tr>
          </table>
    </div>   
  </div>

     <div class="col-md-10 col-md-offset-1 mlist">
         <div class="page-header">
            <h1 class="s1 text-center">内容简介</h1>
            <?php echo $row["intro"];?>       
         </div>
     </div>
     <div class="row box">
<div  class="col-md-10 col-md-offset-1">
   <h3 class="intro-text text-center" style="color:blue;">留言列表</h3>

<table class="tabel table-bordered" align="center">
  <form  method="post" action="index.php?c=index&m=comment" enctype="multipart/form-data">

<font color=white>
<div class="container-fluid control-label col-md-12 ">
<h1 style="color:red;" class="text-center">留言列表</h1>
     <table class="table  table-bordered">
         <?php
         @session_start();
         $cid=$_GET['cid'];
    $sql="select * from cartoons where cid='$cid'";
    $result=mysql_query($sql) or die('查询失败1！'.mysql_error());
    $row=mysql_fetch_assoc($result);
    $sql0="select * from comments where cid='$cid'";
    $result0=mysql_query($sql0) or die('查询失败2！'.mysql_error());
    $totalrows=mysql_num_rows($result0);
        $i=1;   
      while ($rowx=mysql_fetch_assoc($result0)) {    
           ?>  
            <tr>
            <td width="10%"> <?php echo $i++; ?> </td>
            <td width="50%"> <?php echo $rowx['content']; ?> </td>
            <td width="20%">

         <?php 
            $uid=$rowx['uid'];
            $user1=mysql_query("select * from users where uid='$uid'");
            $b=mysql_fetch_assoc($user1);
            echo $b['uname'];
        ?>
            </td>
            <td width="20%"> <?php echo $rowx['cdate']; ?> </td>
            </tr>
    <?php } ?>
    </table>
       </table>
       </div>
       </font>
       </form>

<?php 
@session_start();

if(isset($_SESSION['user']))
{
 ?>
    <div class="col-md-10 col-md-offset-1">
        <h3 class="intro-text text-center">您的留言</h3>
        <form action="index.php?c=index&m=comment" enctype="multipart/form-data" method="post" class="form-horizontal">
        <input type="hidden" name="cid" value=<?php echo $cid; ?>>
        <div class="form-group">
            <div class="col-md-12">
                <textarea name="content" required class="form-control" cols="80" rows="10"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-4 col-md-offset-5 ">
                <input type="submit" class="btn btn-success" value="发表留言">
            </div>
        </div>
        </form>
  
    </div>

<?php }else{ ?>
     
       <div class="col-md-12" style="align:center;">
       <h3><a href="index.php?c=index&m=login"  onclick="func( <?php echo $row['cid']; ?>)">登陆</a>后可以发表留言</h3>
       </div>
   <?php } ?>
 </div>



  
 


